home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / switcher / toastcmdtest.rexx < prev    next >
OS/2 REXX Batch file  |  1993-12-13  |  2KB  |  83 lines

  1. /* ToastCmdTest.rexx -- Test Toaster ARexx command host */
  2. /* By Arnie Cachelin © 1992 NewTek Inc.                              */
  3.  
  4. /*
  5.     This program demonstrates the Toaster Command Host Interface, which is
  6.     implemented in the ARexx program ToasterCommandHost.rexx.  It runs through
  7.     a bunch of commands, with no apparent reason or rhyme. Why? Because it can!
  8.  
  9.         Don't think too much about the similarity between this and the genlock demo.
  10. */
  11.  
  12. options RESULTS    /* Ask ARexx to pass command results along to us */
  13. port=TOASTER_COMMAND_HOST
  14. HOST_EXIT='HOST_EXIT'
  15.  
  16. IF ~SHOW('Ports',PORT) THEN DO
  17.   Say "Can't find "port
  18.   say "running ToasterCommandHost"
  19.   ADDRESS COMMAND "run rx ToasterCommandHost"
  20.   ADDRESS COMMAND "wait 3 secs"
  21.   IF ~SHOW('Ports',PORT) THEN DO
  22.     Say "Can't run ToasterCommandHost"
  23.     exit
  24.   END
  25. END
  26.  
  27. ADDRESS TOASTER_COMMAND_HOST
  28.  
  29. MDV1
  30. PDV2
  31. MEDM
  32. AUTO
  33.  
  34. /*  Build a handy-dandy array of commands to loop through automagically */
  35. cmd.1='M001'
  36. cmd.2='M002'
  37. cmd.4='M003'
  38. cmd.3='M004'
  39. cmd.5='MDV1'
  40. cmd.6='MDV2'
  41. cmd.7='O001'
  42. cmd.8='ODV1'
  43. cmd.9='TAKE'
  44. cmd.10='AUTO'
  45. cmd.11='P001'
  46. cmd.12='P002'
  47. cmd.14='P003'
  48. cmd.13='P004'
  49. cmd.15='PDV1'
  50. cmd.16='PDV2'
  51. cmd.17='ODV2'
  52. cmd.18='DOEN'
  53. cmd.19='SLOW'
  54. cmd.20='LVID'
  55. cmd.21='FAST'
  56. cmd.22='TBAR'
  57. cmd.23='KEYM'
  58. cmd.24='FVID'
  59.  
  60.  
  61. say "Looping through some Toaster commands..."
  62. do i=1 to 23
  63.   interpret cmd.i
  64.   say "command: "cmd.i"  Return Code: "RC"  Result: "RESULT
  65.   end
  66.  
  67. MDV1
  68. PDV2
  69. FMLD 000
  70. TAKE
  71.  
  72. do i=0 to 511 by 20
  73.     say tbar i
  74.     tbar i
  75.     end
  76. do i=0 to 511 by 20
  77.     say tbar 500-i
  78.     tbar 511-i
  79.     end
  80. say 'Shutting down command host'
  81. HOST_EXIT
  82. say 'Exiting'
  83.